<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>开发管理后台 - 微电汇</title>
    <link href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/css/develop/main.css?v=20170708" rel="stylesheet">
</head>

<body>
<!--顶部-->
<div class="top-cont">
    <div class="team-logo">
        <img src="/static/images/develop/logo.png">
    </div>
    <div class="top-nav">
        <div class="top-nav-list">
            <ul>
                <li <?php if($menu_id == 'console'): ?>class="selected"<?php endif; ?>>
                    <a href="/lar/develop?menu=console">
                        <p class="console">控制台</p>
                    </a>
                </li>
                <li <?php if($menu_id == 'setting'): ?>class="selected"<?php endif; ?>>
                    <a href="/lar/develop?menu=setting">
                        <p class="setting">设置</p>
                    </a>
                </li>
                <li <?php if($menu_id == 'checkout'): ?>class="selected"<?php endif; ?>>
                    <a href="/lar/develop?menu=checkout">
                        <p class="setting">结算</p>
                    </a>
                </li>
                <li <?php if($menu_id == 'log'): ?>class="selected"<?php endif; ?>>
                    <a href="/lar/develop?menu=log">
                        <p class="setting">日志</p>
                    </a>
                </li>
            </ul>
        </div>
        <div class="member-infor">
            <ul>
                <li><span class="mem-name"><?php echo e($user_name); ?></span><span>|&nbsp;&nbsp;<a href="/lar/user/logout?redirect_url=<?php echo e($domain_name); ?>/lar/develop">注销</a></span></li>
            </ul>
        </div>
    </div>
</div>

<div class="main-content" id="main-content">

    <!--左侧边栏-->
    <div class="left-sidebar">
        <ul class="nav">
            <?php foreach($left_menus as $l_k => $l_m): ?>
                <li data-index="<?php echo e($l_k); ?>">
                    <span><?php echo e($l_m['name']); ?></span>
                    <div class="arrow"></div>
                </li>
            <?php endforeach; ?>
        </ul>
    </div>

    <!--子菜单栏-->
    <div class="sub-sidebar">
        <ul class="sub-nav-list">
            <?php foreach($left_menus as $l_k => $l_m): ?>
                <?php foreach($l_m['sub'] as $m_m): ?>
                    <li class="sub-nav-<?php echo e($l_k); ?>" style="display: none;">
                        <a href="<?php echo e($m_m['link']); ?>" target="main-frame">
                            <p><?php echo e($m_m['name']); ?></p>
                        </a>
                    </li>
                <?php endforeach; ?>
            <?php endforeach; ?>
        </ul>
    </div>

    <div class="right-sidebar">
        <!--主内容-->
        <div class="main-cont">
            <iframe frameborder="0" id="main-frame" name="main-frame" width="100%" height="100%" ></iframe>
        </div>
    </div>

</div>


<script src="http://cdn.bootcss.com/jquery/2.2.3/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/layer/3.0.1/layer.min.js"></script>

<script>

    $(function() {

        var main_content_obj = $('#main-content');


        //调整iframe高度
        var wh = $(window).height();
        main_content_obj.css('height', (wh-61) + 'px');

        main_content_obj.find('div.sub-sidebar').find('li').click(function () {
            main_content_obj.find('div.sub-sidebar').find('li').removeClass('cur-sub-nav').eq($(this).index()).addClass('cur-sub-nav');
        });

        main_content_obj.find('div.left-sidebar').find('li').click(function () {
            main_content_obj.find('div.left-sidebar').find('li').removeClass('cur-nav').eq($(this).index()).addClass('cur-nav');

            main_content_obj.find('div.sub-sidebar').find('li').hide();

            var sub_nav = $('li.sub-nav-' + $(this).attr('data-index'));
            sub_nav.show();
            sub_nav.eq(0).trigger('click');
            $('#main-frame').attr('src', sub_nav.eq(0).find('a').attr('href'));

            if (sub_nav.length > 1) {
                main_content_obj.find('div.sub-sidebar').show();
                main_content_obj.find('div.right-sidebar').css('padding-left', '240px');
            } else {
                main_content_obj.find('div.sub-sidebar').hide();
                main_content_obj.find('div.right-sidebar').css('padding-left', '120px');
            }

        });
        main_content_obj.find('div.left-sidebar').find('li').eq(0).trigger('click');

    });

</script>
</body>
</html>
